#include<stdio.h>
#include<time.h>
#include<stdlib.h>
double randDouble() {
    return 1.0*rand()/RAND_MAX;
}
int main() {
    srand(time(NULL));
    int N=1000000;
    int M=0;
    int i;
    for(i=0; i<N; i++) {
        double x=randDouble();
        double y=randDouble();
        if(x*x+y*y<=1)
            ++M;
    }
    double pi=4.*M/N;
    printf("%.6f\n",pi);

    return 0;
}
